

<template>
  <iframe ref="frame"
          style="height: 100vh;width:100vw"
          :src="iframeUrl" />
</template>

<script>
export default {
  name: "InstructionsForUse",
  data () {
    return {
      iframeUrl: 'https://manual.wlyuan.com.cn/'
    };
  },
  mounted () {
    // iframe 自适应
    // this.initFrame(this.iframeUrl);
  },
  methods: {
    initFrame (url) {
      let _this = this
      let Frame = _this.$refs["frame"];
      if (Frame.attachEvent) {
        // 兼容浏览器判断
        Frame.attachEvent("onload", function () {
          let iframeWin = Frame.contentWindow;
          iframeWin.postMessage(_this.params, url);
        });
      } else {
        Frame.onload = function () {
          let iframeWin = Frame.contentWindow;
          iframeWin.postMessage(_this.params, url);
        };
      }
    },
  }
};
</script>
